<template>
  <a-textarea
    v-if="isEdit"
    :autoSize="{
      minRows: record.options.minRows,
      maxRows: record.options.maxRows,
    }"
    :disabled="record.options.disabled"
    :placeholder="record.options.placeholder"
    :allowClear="record.options.clearable"
    :maxLength="record.options.maxLength"
    :rows="4"
    v-model="row[record.key]"
    @change="updateStatus({ row, column })"
  ></a-textarea>
  <label v-else>
    {{ row[record.key] }}
  </label>
</template>
<script>
export default {
  name: "gridTextarea",
  data() {
    return {};
  },
  props: ["column", "row", "record", "isEdit"],
  watch: {},
  methods: {
    /**
     * 更改值状态
     */
    updateStatus() {
      this.$emit("change", {
        row: this.row,
        column: this.column,
      });
    },
  },
};
</script>
<style lang="less" scoped></style>
